﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using BPM.Base.DataTypeLib;

namespace BPM.Base.Tools
{
    public static class MyDataFormValidate
    {
        //清除所有属性都为"none" 或 "-1" 的行
        public static void clearDirtyData(ref DataForm dataForm)
        {
            if(dataForm==null)
            {
                return;
            }

            if(dataForm.waitSubmitTab!=null)
            {
                DataForm.waitSubmitTabRow wsRow=dataForm.waitSubmitTab.FirstOrDefault();
                if (wsRow.assignDepartment == "none" && wsRow.assignDuty == "none" && wsRow.assignOvertimeOperate == "none"
                    && wsRow.assignPower == "none" && wsRow.assignTimelimit == -1 && wsRow.assignUser == "none"

                    && wsRow.inceptDepartment == "none" && wsRow.inceptDuty == "none" && wsRow.inceptOvertimeOperate == "none"
                    && wsRow.inceptPower == "none" && wsRow.inceptTimelimit == -1

                    && wsRow.manageDepartment == "none" && wsRow.manageDuty == "none" && wsRow.managePower == "none"
                    && wsRow.manageUser == "none"

                    && wsRow.seeDepartment == "none" && wsRow.seeDuty == "none" && wsRow.seePower == "none"
                    && wsRow.seeUser == "none"

                    && wsRow.transactOption == "none" && wsRow.transactOvertimeOperate == "none" && wsRow.transactPower == "none"
                    && wsRow.transactTimelimit == -1 && wsRow.transactUser == "none")
                {
                    dataForm.waitSubmitTab.Rows.Clear();
                }
                 
            }


           
        }
    }
}
